""" -*- coding: utf-8 -*-"""
from flask import Flask
from utils.exts import init_exts

def create_app():

    app = Flask(__name__)

    # 注册蓝图
    from .views.test_views import test_bp
    app.register_blueprint(test_bp)

    # 配置数据库
    db_url = 'mysql+pymysql://root:root@localhost:3306/file_mg'
    app.config['SQLALCHEMY_DATABASE_URI'] = db_url
    app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False

    # 初始化数据库
    init_exts(app)


    return app